# Copyright 2010-2024 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

exports_files(
    [
        "shift_minimization.dat",
        "wt40.txt",
    ],
)

# Constraint solver examples.
cc_binary(
    name = "binpacking_2d_sat",
    srcs = [
        "binpacking_2d_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/base:path",
        "//ortools/packing:binpacking_2d_parser",
        "//ortools/packing:multiple_dimensions_bin_packing_cc_proto",
        "//ortools/sat:cp_model",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "binpacking_2d_sat_class01_instance2_test",
    size = "medium",
    srcs = [
        "binpacking_2d_sat.cc",
    ],
    args = ["--input $(rootpath //ortools/packing/testdata:Class_01.2bp) --instance 2"],
    data = ["//ortools/packing/testdata:Class_01.2bp"],
    deps = [
        "//ortools/base",
        "//ortools/base:path",
        "//ortools/packing:binpacking_2d_parser",
        "//ortools/packing:multiple_dimensions_bin_packing_cc_proto",
        "//ortools/sat:cp_model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "constraint_programming_cp",
    srcs = ["constraint_programming_cp.cc"],
    deps = [
        "//ortools/base",
        "//ortools/constraint_solver:cp",
    ],
)

cc_test(
    name = "constraint_programming_cp_test",
    size = "small",
    srcs = ["constraint_programming_cp.cc"],
    deps = [
        "//ortools/base",
        "//ortools/constraint_solver:cp",
    ],
)

cc_binary(
    name = "costas_array_sat",
    srcs = ["costas_array_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "costas_array_sat_model1_test",
    size = "medium",
    srcs = ["costas_array_sat.cc"],
    args = [
        "--minsize=6 --maxsize=6 --model=1",
    ],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "costas_array_sat_model2_test",
    size = "medium",
    srcs = ["costas_array_sat.cc"],
    args = [
        "--minsize=6 --maxsize=6 --model=2",
    ],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "costas_array_sat_model3_test",
    size = "medium",
    srcs = ["costas_array_sat.cc"],
    args = [
        "--minsize=6 --maxsize=6 --model=3",
    ],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "cryptarithm_sat",
    srcs = ["cryptarithm_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
    ],
)

cc_test(
    name = "cryptarithm_sat_test",
    size = "small",
    srcs = ["cryptarithm_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
    ],
)

cc_binary(
    name = "dobble_ls",
    srcs = ["dobble_ls.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "//ortools/util:bitset",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "dobble_ls_test",
    size = "medium",
    srcs = ["dobble_ls.cc"],
    args = ["--time_limit_in_ms=10000"],
    deps = [
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "//ortools/util:bitset",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "golomb_sat",
    srcs = ["golomb_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "golomb_sat_test",
    size = "medium",
    srcs = ["golomb_sat.cc"],
    args = ["--size 5"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "knapsack_2d_sat",
    srcs = [
        "knapsack_2d_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/packing:binpacking_2d_parser",
        "//ortools/packing:multiple_dimensions_bin_packing_cc_proto",
        "//ortools/sat:cp_model",
        "//ortools/sat:cp_model_solver",
        "@com_google_absl//absl/flags:flag",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "knapsack_2d_sat_class01_instance2_test",
    size = "medium",
    srcs = [
        "knapsack_2d_sat.cc",
    ],
    args = ["--input $(rootpath //ortools/packing/testdata:Class_01.2bp) --instance 2"],
    data = ["//ortools/packing/testdata:Class_01.2bp"],
    deps = [
        "//ortools/base",
        "//ortools/packing:binpacking_2d_parser",
        "//ortools/packing:multiple_dimensions_bin_packing_cc_proto",
        "//ortools/sat:cp_model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "jobshop_sat",
    srcs = [
        "jobshop_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:timer",
        "//ortools/sat:cp_model",
        "//ortools/sat:cp_model_solver",
        "//ortools/sat:model",
        "//ortools/scheduling:jobshop_scheduling_cc_proto",
        "//ortools/scheduling:jobshop_scheduling_parser",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "jobshop_sat_ft06",
    size = "small",
    srcs = [
        "jobshop_sat.cc",
    ],
    args = ["--input $(rootpath //ortools/scheduling/testdata:ft06)"],
    data = ["//ortools/scheduling/testdata:ft06"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:timer",
        "//ortools/sat:cp_model",
        "//ortools/sat:cp_model_solver",
        "//ortools/sat:model",
        "//ortools/scheduling:jobshop_scheduling_cc_proto",
        "//ortools/scheduling:jobshop_scheduling_parser",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "magic_sequence_sat",
    srcs = ["magic_sequence_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "magic_sequence_sat_test",
    size = "medium",
    srcs = ["magic_sequence_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "multi_knapsack_sat",
    srcs = [
        "multi_knapsack_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "@com_google_absl//absl/flags:flag",
    ],
)

cc_test(
    name = "multi_knapsack_sat_test",
    size = "medium",
    srcs = [
        "multi_knapsack_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "@com_google_absl//absl/flags:flag",
    ],
)

cc_binary(
    name = "shift_minimization_sat",
    srcs = [
        "shift_minimization_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "//ortools/util:filelineiter",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "shift_minimization_sat_test",
    size = "medium",
    srcs = [
        "shift_minimization_sat.cc",
    ],
    args = ["--input $(rootpath //examples/cpp:shift_minimization.dat)"],
    data = ["//examples/cpp:shift_minimization.dat"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "//ortools/util:filelineiter",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "weighted_tardiness_sat",
    srcs = [
        "weighted_tardiness_sat.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/sat:cp_model",
        "//ortools/sat:cp_model_solver",
        "//ortools/sat:disjunctive",
        "//ortools/sat:integer",
        "//ortools/sat:integer_expr",
        "//ortools/sat:intervals",
        "//ortools/sat:model",
        "//ortools/sat:optimization",
        "//ortools/sat:precedences",
        "//ortools/sat:sat_solver",
        "//ortools/util:filelineiter",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "weighted_tardiness_sat_test",
    size = "medium",
    srcs = [
        "weighted_tardiness_sat.cc",
    ],
    args = ["--input $(rootpath //examples/cpp:wt40.txt)"],
    data = ["//examples/cpp:wt40.txt"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/sat:cp_model",
        "//ortools/sat:cp_model_solver",
        "//ortools/sat:disjunctive",
        "//ortools/sat:integer",
        "//ortools/sat:integer_expr",
        "//ortools/sat:intervals",
        "//ortools/sat:model",
        "//ortools/sat:optimization",
        "//ortools/sat:precedences",
        "//ortools/sat:sat_solver",
        "//ortools/util:filelineiter",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "magic_square_sat",
    srcs = ["magic_square_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "magic_square_sat_test",
    size = "medium",
    srcs = ["magic_square_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "network_routing_sat",
    srcs = ["network_routing_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:hash",
        "//ortools/base:map_util",
        "//ortools/graph:shortest_paths",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "//ortools/util:tuple_set",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "network_routing_sat_test",
    size = "medium",
    srcs = ["network_routing_sat.cc"],
    args = ["--clients=10 --backbones=5 --demands=10 --traffic_min=5 --traffic_max=10 --min_client_degree=2 --max_client_degree=5 --min_backbone_degree=3 --max_backbone_degree=5 --max_capacity=20 --fixed_charge_cost=10"],
    deps = [
        "//ortools/base",
        "//ortools/base:hash",
        "//ortools/base:map_util",
        "//ortools/graph:shortest_paths",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "//ortools/util:tuple_set",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "nqueens",
    srcs = ["nqueens.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "nqueens_test",
    srcs = ["nqueens.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "sports_scheduling_sat",
    srcs = ["sports_scheduling_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "sports_scheduling_sat_test",
    size = "medium",
    srcs = ["sports_scheduling_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "vector_bin_packing_solver",
    srcs = [
        "vector_bin_packing_solver.cc",
    ],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/packing:arc_flow_builder",
        "//ortools/packing:arc_flow_solver",
        "//ortools/packing:vector_bin_packing_cc_proto",
        "//ortools/packing:vector_bin_packing_parser",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "vector_bin_packing_solver_test",
    size = "medium",
    srcs = [
        "vector_bin_packing_solver.cc",
    ],
    args = ["--input $(rootpath //ortools/packing/testdata:1D__bpp_scholl__bin2data.N2W2B1R0.vbp)"],
    data = ["//ortools/packing/testdata:1D__bpp_scholl__bin2data.N2W2B1R0.vbp"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/packing:arc_flow_builder",
        "//ortools/packing:arc_flow_solver",
        "//ortools/packing:vector_bin_packing_cc_proto",
        "//ortools/packing:vector_bin_packing_parser",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

# Routing examples.
cc_binary(
    name = "random_tsp",
    srcs = ["random_tsp.cc"],
    deps = [
        "//ortools/base",
        "//ortools/constraint_solver:routing",
        "//ortools/util:random_engine",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "cvrptw_lib",
    hdrs = ["cvrptw_lib.h"],
    deps = [
        "//ortools/base",
        "//ortools/constraint_solver:routing",
        "//ortools/util:random_engine",
    ],
)

cc_binary(
    name = "cvrptw",
    srcs = ["cvrptw.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
    ],
)

cc_binary(
    name = "cvrp_disjoint_tw",
    srcs = ["cvrp_disjoint_tw.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
    ],
)

cc_binary(
    name = "cvrptw_with_breaks",
    srcs = ["cvrptw_with_breaks.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
        "//ortools/constraint_solver:routing_enums_cc_proto",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "cvrptw_with_resources",
    srcs = ["cvrptw_with_resources.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
    ],
)

cc_binary(
    name = "cvrptw_with_stop_times_and_resources",
    srcs = ["cvrptw_with_stop_times_and_resources.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "cvrptw_with_refueling",
    srcs = ["cvrptw_with_refueling.cc"],
    deps = [
        ":cvrptw_lib",
        "//ortools/base",
        "//ortools/constraint_solver:routing",
    ],
)

cc_binary(
    name = "pdptw",
    srcs = ["pdptw.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:mathutil",
        "//ortools/constraint_solver:routing",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_protobuf//:protobuf",
    ],
)

# Linear and integer programming examples.
cc_binary(
    name = "integer_programming",
    srcs = ["integer_programming.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "integer_programming_test",
    size = "small",
    srcs = ["integer_programming.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "linear_programming",
    srcs = ["linear_programming.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "linear_programming_test",
    size = "small",
    srcs = ["linear_programming.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "linear_solver_protocol_buffers",
    srcs = ["linear_solver_protocol_buffers.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "//ortools/linear_solver:linear_solver_cc_proto",
    ],
)

cc_binary(
    name = "strawberry_fields_with_column_generation",
    srcs = ["strawberry_fields_with_column_generation.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "strawberry_fields_with_column_generation_test",
    size = "large",
    srcs = ["strawberry_fields_with_column_generation.cc"],
    args = ["--colgen_instance=4"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "@com_google_absl//absl/strings:str_format",
    ],
)

# Dimacs assignment problems
cc_library(
    name = "print_dimacs_assignment",
    hdrs = ["print_dimacs_assignment.h"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:linear_assignment",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_library(
    name = "parse_dimacs_assignment",
    hdrs = ["parse_dimacs_assignment.h"],
    deps = [
        "//ortools/base",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:linear_assignment",
        "//ortools/util:filelineiter",
        "@com_google_absl//absl/strings",
    ],
)

cc_binary(
    name = "dimacs_assignment",
    srcs = ["dimacs_assignment.cc"],
    deps = [
        ":parse_dimacs_assignment",
        ":print_dimacs_assignment",
        "//ortools/algorithms:hungarian",
        "//ortools/base",
        "//ortools/base:timer",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:linear_assignment",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings:str_format",
    ],
)

# MPS driver for LP and MIP.
cc_binary(
    name = "mps_driver",
    srcs = ["mps_driver.cc"],
    deps = [
        "//ortools/base",
        "//ortools/base:timer",
        "//ortools/glop:lp_solver",
        "//ortools/glop:parameters_cc_proto",
        "//ortools/lp_data:mps_reader",
        "//ortools/util:proto_tools",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_test(
    name = "mps_driver_test",
    size = "small",
    srcs = ["mps_driver.cc"],
    args = ["--input $(rootpath //ortools/linear_solver/testdata:maximization.mps)"],
    data = ["//ortools/linear_solver/testdata:maximization.mps"],
    deps = [
        "//ortools/base",
        "//ortools/base:timer",
        "//ortools/glop:lp_solver",
        "//ortools/glop:parameters_cc_proto",
        "//ortools/lp_data:mps_reader",
        "//ortools/util:proto_tools",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_protobuf//:protobuf",
    ],
)

# Linear Assignment C++ Example
cc_binary(
    name = "linear_assignment_api",
    srcs = ["linear_assignment_api.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:linear_assignment",
    ],
)

cc_test(
    name = "linear_assignment_api_test",
    size = "small",
    srcs = ["linear_assignment_api.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:linear_assignment",
    ],
)

# Flow C++ Example
cc_binary(
    name = "flow_api",
    srcs = ["flow_api.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:max_flow",
        "//ortools/graph:min_cost_flow",
    ],
)

cc_test(
    name = "flow_api_test",
    size = "small",
    srcs = ["flow_api.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:ebert_graph",
        "//ortools/graph:max_flow",
        "//ortools/graph:min_cost_flow",
    ],
)

cc_binary(
    name = "max_flow",
    srcs = ["max_flow.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:max_flow",
    ],
)

cc_test(
    name = "max_flow_test",
    size = "small",
    srcs = ["max_flow.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:max_flow",
    ],
)

cc_binary(
    name = "min_cost_flow",
    srcs = ["min_cost_flow.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:min_cost_flow",
    ],
)

cc_test(
    name = "min_cost_flow_test",
    size = "small",
    srcs = ["min_cost_flow.cc"],
    deps = [
        "//ortools/base",
        "//ortools/graph:min_cost_flow",
    ],
)

# Frequency Assignment Problem
cc_library(
    name = "fap_parser",
    hdrs = ["fap_parser.h"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:hash",
        "//ortools/base:map_util",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "fap_model_printer",
    hdrs = ["fap_model_printer.h"],
    deps = [
        ":fap_parser",
        "//ortools/base",
        "//ortools/base:file",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_library(
    name = "fap_utilities",
    hdrs = ["fap_utilities.h"],
    deps = [
        ":fap_parser",
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "@com_google_absl//absl/container:btree",
    ],
)

cc_binary(
    name = "frequency_assignment_problem",
    srcs = ["frequency_assignment_problem.cc"],
    deps = [
        ":fap_model_printer",
        ":fap_parser",
        ":fap_utilities",
        "//ortools/base",
        "//ortools/base:map_util",
        "//ortools/constraint_solver:cp",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/strings",
    ],
)

# Quadratic assignment problem.
cc_binary(
    name = "qap_sat",
    srcs = ["qap_sat.cc"],
    deps = [
        "//ortools/base",
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "//ortools/sat:sat_parameters_cc_proto",
        "//ortools/util:qap_reader",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "slitherlink_sat",
    srcs = ["slitherlink_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "slitherlink_sat_test",
    size = "small",
    srcs = ["slitherlink_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:model",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_binary(
    name = "uncapacitated_facility_location",
    srcs = ["uncapacitated_facility_location.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/flags:parse",
        "@com_google_absl//absl/random",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_binary(
    name = "variable_intervals_sat",
    srcs = ["variable_intervals_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:sat_parameters_cc_proto",
        "//ortools/util:time_limit",
    ],
)

cc_test(
    name = "variable_intervals_sat_test",
    size = "small",
    srcs = ["variable_intervals_sat.cc"],
    deps = [
        "//ortools/sat:cp_model",
        "//ortools/sat:sat_parameters_cc_proto",
        "//ortools/util:time_limit",
    ],
)

cc_binary(
    name = "pdlp_solve",
    srcs = ["pdlp_solve.cc"],
    deps = [
        "//ortools/base",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/pdlp:primal_dual_hybrid_gradient",
        "//ortools/pdlp:quadratic_program_io",
        "//ortools/pdlp:solve_log_cc_proto",
        "//ortools/pdlp:solvers_cc_proto",
        "//ortools/port:proto_utils",
        "//ortools/util:sigint",
        "@com_google_absl//absl/time",
    ],
)
